package com.situ.web.test;

import org.junit.Test;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Demo {
    @Test
    public void test88() {
        Date date = new Date();
        // Mon Aug 16 15:31:09 CST 2021
        System.out.println(date);
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        String time = format.format(date);
        System.out.println(time); //2021-08-16 03:31:09
    }

    @Test
    public void test1() {
        int num = 10;
        num = 20;
        foo(num);
        System.out.println(num); // 20
    }

    void foo(int num) {
        num = 100;
    }

    @Test
    public void test2() {
        String str = "hello";
        str = "java";
        foo(str);
        System.out.println(str);// java
    }

    void foo(String text) {
        text = "windows";
    }


    public static void main(String[] args) {
        int totalCount = 12;
        int pageSize = 5;
        System.out.println(totalCount / pageSize); // 2
        System.out.println((double)totalCount / pageSize);// 2.4
        int totapPage = (int)((double)totalCount / pageSize);
        System.out.println(totapPage);
    }
}
